package base;

/**
 * @author Administrator
 */
public class Demo2 {
    public static void main(String[] args) {
        //强制类型转换是从高到低
        //由低到高：byte,short,char==int==long==float==double
        int money = 10_0000_0000;
        int year = 20;
        //内存溢出
        int total = money*year;
        //默认是int,转换之前就已经内存溢出，所以也是错误的
        long total2 = money*year;
        System.out.println(total+"=="+total2);

        long total3 = money*(long)year;
        System.out.println(total3);
    }
}
